<template>

    <div style="width: 100%;height:100%;">
        <mavon-editor style="width: 100%;height:100%;" v-model="content" />
    </div>
</template>

<script>
import mavonEditor from 'mavon-editor'
export default {
    name: 'Note',
    components: {
        mavonEditor
    },
    props: {
        note: {
            type: String,
            default: ''
        },
        lydata: {
            type: Object,
            default: () => {
                return {}
            }
        }
    },
    data() {
        return {
            content: '',
            editorOption: {}
        }
    },
    computed: {
    },
    mounted() {
        this.content = this.note
    },
    methods: {

    },
    beforeDestroy() {
        // 可以考虑一下销毁前有什么重置保存的呢？
        console.log('beforeDestroy 保存note')
        this.$root.$emit('updateSnippetNote', this.content)
    }
}
</script>
<style>

</style>
